program S2_3;
var a:array[1..10,1..10] of integer;
    sum,i,j,max,tmp:integer;
begin
for i:=1 to 10 do for j:=1 to 10 do a[i,j]:=random(100)-50;
for i:=1 to 10 do begin for j:=1 to 10 do write(a[i,j]:4); writeln; end;
sum:=0;
for i:=1 to 10 do begin
	tmp:=a[i,1];
	for j:=2 to 10 do if a[i,j]>tmp then tmp:=a[i,j];
	sum:=sum+tmp;
	end;
writeln(sum);
end.
